From: Florian Müllner Date: Wed, 2 Dec 2015 15:44:05 +0000 (-0800) Subject: background: Reload animation on timezone changes X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~1048 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=965aedb0bb15c0246c67384e2dab13fa027df917;p=gnome-shell.git background: Reload animation on timezone changes Animated backgrounds are based on a start time in local time - in case of a timezone change, that time is no longer accurate. To fix, we need to either make BGSlideShow aware of timezone changes (and notify us to update the animation), or just reload the animation - timezone changes should be a rare event, so go with the simpler second option. https://bugzilla.gnome.org/show_bug.cgi?id=758939 --- diff --git a/js/ui/background.js b/js/ui/background.js index e2f9a473b..5db1e6c8c 100644 --- a/js/ui/background.js +++ b/js/ui/background.js @@ -247,6 +247,13 @@ const Background = new Lang.Class({ this._cancellable = new Gio.Cancellable(); this.isLoaded = false; + this._clock = new GnomeDesktop.WallClock(); + this._timezoneChangedId = this._clock.connect('notify::timezone', + Lang.bind(this, function() { + if (this._animation) + this._loadAnimation(this._animation.file); + })); + this._settingsChangedSignalId = this._settings.connect('changed', Lang.bind(this, function() { this.emit('changed'); })); @@ -265,6 +272,10 @@ const Background = new Lang.Class({ } this._fileWatches = null; + if (this._timezoneChangedId != 0) + this._clock.disconnect(this._timezoneChangedId); + this._timezoneChangedId = 0; + if (this._settingsChangedSignalId != 0) this._settings.disconnect(this._settingsChangedSignalId); this._settingsChangedSignalId = 0;